Skip to content

Commit 0aa3c5b

Browse files
[PRM-495] Fix for mesh-forwarder python modules in Dockerfile
1 parent 29438a7 commit 0aa3c5b

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

services/mesh-forwarder/Dockerfile

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,23 @@ ARG IMAGE_TAG=image_tag \
77
ENV BUILD_TAG=${IMAGE_TAG}
88

99
RUN addgroup --system mesh && adduser --ingroup mesh --system mesh
10-
COPY . /mesh-forwarder
10+
11+
# This sets the working directory for ALL subsequent RUNs and for ENTRYPOINT
12+
WORKDIR ${FORWARDER_HOME}
13+
14+
# Copy project into WORKDIR (so src is at /mesh-forwarder/src)
15+
COPY . .
1116

1217
RUN python -m venv /opt/venv
1318
ENV PATH="/opt/venv/bin:$PATH"
19+
1420
RUN pip install pipenv
15-
RUN cd /mesh-forwarder && pipenv install
1621

17-
RUN chown -R mesh:mesh /mesh-forwarder
22+
# Install dependencies into the current env instead of creating another venv
23+
RUN pipenv install --deploy --system
1824

25+
RUN chown -R mesh:mesh ${FORWARDER_HOME}
1926
USER mesh
2027

28+
# Now that CWD=/mesh-forwarder and src/ exists there, this works:
2129
ENTRYPOINT ["python", "-m", "src.awsmesh.entrypoint"]

0 commit comments

Comments
 (0)