Skip to content

Commit

Permalink
Change Dockerfile to fix issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin authored Oct 30, 2022
1 parent a8b176b commit aac422f
Showing 1 changed file with 35 additions and 7 deletions.
42 changes: 35 additions & 7 deletions db/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,37 @@
FROM mysql:latest
FROM python:3.8-alpine

COPY ./products.csv /products.csv
COPY ./users.csv /users.csv
COPY ./setup.sql /docker-entrypoint-initdb.d/setup.sql
ENV PATH="/scripts:${PATH}"

ENTRYPOINT ["/entrypoint.sh"]
CMD ["mysqld", "--secure-file-priv=/"]
#CMD ["--secure-file-priv=/"]
COPY requirements.txt /requirements.txt

RUN apk add --update --no-cache --virtual .tmp gcc libc-dev linux-headers
RUN apk add --update mysql-client
RUN apk add --update mariadb-dev
RUN pip3 install -r /requirements.txt

RUN apk del .tmp

RUN mkdir /GiftcardSite

COPY ./GiftcardSite /GiftcardSite

WORKDIR /GiftcardSite

COPY ./scripts /scripts

RUN chmod +x /scripts/*

RUN mkdir -p /vol/web/media
RUN mkdir -p /vol/web/static

RUN adduser -D django-app

RUN chown -R django-app:django-app /vol

RUN chmod -R 755 /vol/web

RUN chown -R django-app:django-app /GiftcardSite

USER django-app

CMD ["entrypoint.sh"]

0 comments on commit aac422f

Please sign in to comment.