forked from enpitut2022/A_plus_Tsukuba
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
42 lines (31 loc) · 993 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
40
41
42
# Dockerfile for A_plus_tsukuba service container
# Download python image
# Python version is same as the production.
FROM python:3.8.10-buster
# Cast a spell
ENV PYTHONUNBUFFERED 1
# MySQL Connector
RUN apt-get update
RUN apt-get -y install default-mysql-client
RUN mkdir /a_plus_tsukuba
# Install poerty
ENV POETRY_HOME=/opt/poetry
RUN curl -sSL https://install.python-poetry.org | python - && \
cd /usr/local/bin && \
ln -s /opt/poetry/bin/poetry && \
poetry config virtualenvs.create false
# venv is not used in the container
# Set working dir
WORKDIR /a_plus_tsukuba
# Copy poetry files
COPY ./pyproject.toml* ./poetry.lock* ./
# Install Dependencies
RUN poetry install --no-root
# Cast a spell "--no-root" cf. https://github.com/python-poetry/poetry/issues/689
# Copy .env for local
COPY ./.env_local ./.env
# Copy files
COPY ./manage.py ./
COPY ./pytest.ini ./
# NOTICE
# ./A_plus_Tsukuba and ./board are synchronized by volume configs in docker-compose.yml