Skip to content

Commit

Permalink
Copy backend startup script into dockerfile. Currently can't file scr…
Browse files Browse the repository at this point in the history
…ipt in container.
  • Loading branch information
fergmac committed Aug 8, 2024
1 parent 6043c2c commit df499a3
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 15 deletions.
33 changes: 28 additions & 5 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM python:3.7-slim

RUN apt-get -y update
FROM python:3.7-slim AS build

RUN apt-get -y install git build-essential libgdal-dev
RUN apt-get -y update && \
apt-get -y install git build-essential libgdal-dev && \
apt-get install -y apt-utils

ENV PATH="/usr/bin/python3:${PATH}"

Expand All @@ -12,6 +12,29 @@ RUN python3 -m pip install 'setuptools<58.0'
RUN python3 -m pip install --upgrade pip

COPY . /app
# COPY ./backend-command-script.sh /backend-command-script.sh

# RUN chmod +x load_fixtures.sh works when i pull the dockerfile into backend but not when dockerfile is with other docker files
RUN chmod +x /app
RUN chmod +x /app

# make script executable
# RUN chmod +x /backend/backend-command-script.sh

# production image step
FROM python:3.7-slim

# TODO: need to confirm version of libgdal-dev used with FROM python version
RUN apt-get -y update && \
apt-get -y install libgdal32

ENV PATH="/usr/bin/python3:${PATH}"

WORKDIR /app

COPY --from=build /app /app
# COPY --from=build /backend-command-script.sh /backend-command-script.sh

# make script executable
# RUN chmod +x /backend/backend-command-script.sh

CMD ["/backend-command-scripts.sh"]
File renamed without changes.
20 changes: 10 additions & 10 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -194,16 +194,16 @@ services:
EMAIL_NOTIFICATION_RECIPIENT: [email protected]
GEOCODER_ADDRESS_API_BASE: https://geocoder.api.gov.bc.ca/addresses.json?
LOCAL: True
command: ./scripts/backend-command-script.sh
volumes:
- type: bind
source: ./backend
target: /backend
consistency: cached
- type: bind
source: ./scripts/backend-command-script.sh
target: /scripts/backend-command-script.sh
consistency: cached
LOAD_FIXTURES: True
# volumes:
# - type: bind
# source: ./backend
# target: /backend
# consistency: cached
# - type: bind
# source: ./scripts/backend-command-script.sh
# target: /scripts/backend-command-script.sh
# consistency: cached
ports:
- "8000:8000"
- "3000:3000"
Expand Down

0 comments on commit df499a3

Please sign in to comment.