Skip to content

Commit

Permalink
Setting env variables directly
Browse files Browse the repository at this point in the history
  • Loading branch information
MitchellAV committed Aug 13, 2024
1 parent f64dfa4 commit 1be35e5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
6 changes: 0 additions & 6 deletions workers/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
FROM python:3.11-slim

ARG DOCKER_HOST_VOLUME_DATA_DIR=${DOCKER_HOST_VOLUME_DATA_DIR}
ARG DOCKER_HOST_VOLUME_RESULTS_DIR=${DOCKER_HOST_VOLUME_RESULTS_DIR}

WORKDIR /root/worker
COPY . .

RUN mkdir -p /root/worker/logs

ENV DOCKER_HOST_VOLUME_DATA_DIR=${DOCKER_HOST_VOLUME_DATA_DIR}
ENV DOCKER_HOST_VOLUME_RESULTS_DIR=${DOCKER_HOST_VOLUME_RESULTS_DIR}

ENV PORT 8500
EXPOSE 8500
EXPOSE 65535
Expand Down
10 changes: 7 additions & 3 deletions workers/Dockerfile.prod
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,14 @@ ARG DOCKER_HOST_VOLUME_RESULTS_DIR
RUN mkdir -p .aws
RUN mkdir worker

# Set environment variables for prod
RUN awk -v DOCKER_HOST_VOLUME_DATA_DIR=${DOCKER_HOST_VOLUME_DATA_DIR} -v DOCKER_HOST_VOLUME_RESULTS_DIR=${DOCKER_HOST_VOLUME_RESULTS_DIR} \
'BEGIN {print "export DOCKER_HOST_VOLUME_DATA_DIR=" DOCKER_HOST_VOLUME_DATA_DIR "\nexport DOCKER_HOST_VOLUME_RESULTS_DIR=" DOCKER_HOST_VOLUME_RESULTS_DIR > "/home/.profile"}'
WORKDIR /home

# # Set environment variables for prod
# RUN awk -v DOCKER_HOST_VOLUME_DATA_DIR=${DOCKER_HOST_VOLUME_DATA_DIR} -v DOCKER_HOST_VOLUME_RESULTS_DIR=${DOCKER_HOST_VOLUME_RESULTS_DIR} \
# 'BEGIN {print "export DOCKER_HOST_VOLUME_DATA_DIR=" DOCKER_HOST_VOLUME_DATA_DIR "\nexport DOCKER_HOST_VOLUME_RESULTS_DIR=" DOCKER_HOST_VOLUME_RESULTS_DIR > "/home/.profile"}'
# Set environment variables for prod
ENV DOCKER_HOST_VOLUME_DATA_DIR=${DOCKER_HOST_VOLUME_DATA_DIR}
ENV DOCKER_HOST_VOLUME_RESULTS_DIR=${DOCKER_HOST_VOLUME_RESULTS_DIR}

WORKDIR /root/.aws

Expand Down

0 comments on commit 1be35e5

Please sign in to comment.