Skip to content

Commit cc040f8

Browse files
authored
Merge pull request #17 from cmu-delphi/docker_fix
created Ubuntu docker container that works on linux now
2 parents c349119 + c006052 commit cc040f8

File tree

2 files changed

+25
-19
lines changed

2 files changed

+25
-19
lines changed

Dockerfile

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,24 @@
1-
FROM python:3.10.8-alpine
1+
FROM ubuntu:latest
22

33
ENV PYTHONDONTWRITEBYTECODE=1
44
ENV PYTHONUNBUFFERED=1
5-
RUN addgroup -S python && adduser -S python -G python
6-
RUN apk update
7-
RUN apk add musl-dev mariadb-dev gcc
8-
RUN apk add graphviz-dev
9-
RUN pip install -U pipenv
10-
USER python
5+
COPY Pipfile Pipfile.lock ./
6+
7+
RUN apt-get update -y
8+
RUN apt-get install -y gcc default-libmysqlclient-dev pkg-config
9+
RUN apt-get install mysql-client -y
10+
RUN apt-get install graphviz graphviz-dev -y
11+
RUN apt-get install python3 -y
12+
RUN apt-get install python3-pip -y
13+
RUN python3 -m pip install --upgrade pip
14+
RUN pip3 install pipenv
15+
RUN pipenv requirements > requirements.txt
16+
RUN pip3 install -r requirements.txt
17+
1118
WORKDIR /home/python
12-
COPY --chown=python:python Pipfile Pipfile.lock ./
13-
RUN pipenv install --system --deploy
14-
COPY --chown=python:python /src .
15-
COPY --chown=python:python /gunicorn/gunicorn.py .
19+
# RUN pipenv install --system --deploy
20+
COPY /src .
21+
COPY /gunicorn/gunicorn.py .
1622
ENV PATH="/home/python/.local/bin:${PATH}"
1723
EXPOSE 8000
18-
CMD ["gunicorn", "signal_documentation.wsgi:application", "-c", "gunicorn.py"]
24+
CMD ["gunicorn", "signal_documentation.wsgi:application", "-c", "gunicorn.py"]

docker-compose.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ services:
2323
env_file:
2424
- ./.env
2525
container_name: signal_documentation-web
26-
command: sh -c "python /usr/src/signal_documentation/src/manage.py migrate --noinput &&
27-
python /usr/src/signal_documentation/src/manage.py collectstatic --noinput &&
28-
python /usr/src/signal_documentation/src/manage.py loaddata ./fixtures/available_geography.json &&
29-
python /usr/src/signal_documentation/src/manage.py loaddata ./fixtures/pathogens.json &&
30-
python /usr/src/signal_documentation/src/manage.py loaddata ./fixtures/signal_types.json &&
31-
python /usr/src/signal_documentation/src/manage.py loaddata ./fixtures/signal_categories.json &&
32-
python /usr/src/signal_documentation/src/manage.py runserver 0.0.0.0:8000"
26+
command: sh -c "python3 /usr/src/signal_documentation/src/manage.py migrate --noinput &&
27+
python3 /usr/src/signal_documentation/src/manage.py collectstatic --noinput &&
28+
python3 /usr/src/signal_documentation/src/manage.py loaddata ./fixtures/available_geography.json &&
29+
python3 /usr/src/signal_documentation/src/manage.py loaddata ./fixtures/pathogens.json &&
30+
python3 /usr/src/signal_documentation/src/manage.py loaddata ./fixtures/signal_types.json &&
31+
python3 /usr/src/signal_documentation/src/manage.py loaddata ./fixtures/signal_categories.json &&
32+
python3 /usr/src/signal_documentation/src/manage.py runserver 0.0.0.0:8000"
3333
volumes:
3434
- .:/usr/src/signal_documentation
3535
ports:

0 commit comments

Comments
 (0)