Skip to content

Commit bac7235

Browse files
committed
adding alembic configuration and migrations into the docker image
1 parent ff2231a commit bac7235

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

.dockerignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,7 @@
44
!/.git/
55
!/README.md
66
!/ui
7+
!/alembic.ini
8+
!/alembic/
79
ui/dist
8-
ui/node_modules
10+
ui/node_modules

Dockerfile

+12-1
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,16 @@ COPY --from=backend-builder /build/dist/*.whl /tmp
4040
RUN python -m pip install /tmp/*.whl
4141
RUN rm -f /tmp/*.whl
4242

43+
# Add the application user
44+
RUN addgroup --system foxops --gid 2102 \
45+
&& adduser --system foxops --ingroup foxops --uid 2102 --home /home/foxops
46+
USER foxops
47+
WORKDIR /home/foxops
48+
49+
# Copy database migrations into the image, so that they can be applied
50+
COPY ./alembic.ini alembic.ini
51+
COPY ./alembic/versions alembic/versions
52+
COPY ./alembic/env.py alembic/env.py
53+
4354
EXPOSE 80
44-
CMD [ "uvicorn", "foxops.__main__:create_app", "--factory", "--proxy-headers", "--host", "0.0.0.0", "--port", "80" ]
55+
CMD [ "uvicorn", "foxops.__main__:create_app", "--factory", "--proxy-headers", "--host", "0.0.0.0", "--port", "80" ]

0 commit comments

Comments
 (0)