-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1093 from coderanger/dockerfile-improvements
Improvements for Dockerfile
- Loading branch information
Showing
1 changed file
with
8 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,19 @@ | ||
FROM python:3.6.6-alpine3.8 as builder | ||
FROM python:3.6-alpine as builder | ||
|
||
RUN apk --no-cache add g++ zeromq-dev | ||
RUN pip install locustio pyzmq | ||
COPY . /src | ||
WORKDIR /src | ||
RUN pip install . | ||
|
||
FROM python:3.6.6-alpine3.8 | ||
FROM python:3.6-alpine | ||
|
||
RUN apk --no-cache add zeromq-dev | ||
RUN apk --no-cache add zeromq && adduser -h / -s /bin/false -H -D locust | ||
COPY --from=builder /usr/local/lib/python3.6/site-packages /usr/local/lib/python3.6/site-packages | ||
COPY --from=builder /usr/local/bin/locust /usr/local/bin/locust | ||
COPY docker_start.sh docker_start.sh | ||
RUN chmod +x docker_start.sh | ||
|
||
EXPOSE 8089 5557 5558 | ||
|
||
ENTRYPOINT ["./docker_start.sh"] | ||
USER locust | ||
CMD ["./docker_start.sh"] |