forked from Syncplay/syncplay
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
39 lines (26 loc) · 825 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
FROM docker.io/library/python:3.8 as build-env
# Set pip to have cleaner logs and no saved cache
ENV PIP_NO_CACHE_DIR=false \
PIPENV_HIDE_EMOJIS=1 \
PIPENV_IGNORE_VIRTUALENVS=1 \
PIPENV_NOSPIN=1
# Install pipenv
RUN pip install -U pipenv
# Create the working directory
WORKDIR /app
# Copy Pipfiles
COPY Pipfile* ./
# Install project dependencies
RUN pipenv install --dev --deploy
# Copy project files into working directory
# This is done last to prevent unnecessary image rebuilds
COPY . .
# Build pex file
RUN pipenv run shiv-build
FROM docker.io/library/python:3.8-slim
LABEL org.opencontainers.image.source https://github.com/weeb-poly/syncplay-server
# Create the working directory
WORKDIR /app
# Copy pex file from build-env
COPY --from=build-env /app/syncplay.pyz /app/
CMD ["./syncplay.pyz"]