-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
27cbd1b
commit e99d813
Showing
7 changed files
with
84 additions
and
40 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
FROM python:latest | ||
WORKDIR /home/plakplaats | ||
|
||
# Install build dependencies | ||
RUN apt-get update && \ | ||
apt-get install -y --no-install-recommends \ | ||
libpq-dev gcc | ||
RUN rm -rf /var/lib/apt/lists/* | ||
|
||
# Install required python packages | ||
COPY requirements.txt ./ | ||
RUN pip install -r requirements.txt --no-cache-dir | ||
|
||
# Copy over remaining files | ||
COPY . . | ||
|
||
# Document which ports will be used | ||
EXPOSE 3000 | ||
|
||
# Give a warm welcome | ||
ENV SHELL="/bin/bash" | ||
RUN echo "echo 'You are in the plakplaats devcontainer!'" >> /etc/bash.bashrc | ||
RUN echo "echo 'Start the server with: python src/server.py'" >> /etc/bash.bashrc | ||
|
||
# Do not run anything, but do not close the container either | ||
CMD ["tail", "-f", "/dev/null"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Inherit but overwrite production configs with development configs | ||
|
||
include: | ||
- path: ../docker-compose.yml | ||
|
||
services: | ||
website-dev: | ||
build: | ||
context: .. | ||
dockerfile: .devcontainer/Dockerfile.website | ||
ports: | ||
- "3000:3000" | ||
depends_on: | ||
- postgres_db |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
FROM python:alpine | ||
WORKDIR /home/plakplaats | ||
|
||
# Install build dependencies | ||
RUN apk add --no-cache postgresql-libs | ||
RUN apk add --no-cache --virtual .build-deps gcc musl-dev postgresql-dev | ||
|
||
# Copy the files responsible for listing dependencies | ||
COPY requirements.txt ./ | ||
|
||
# Cache the python dependencies | ||
RUN python3 -m pip install -r requirements.txt --no-cache-dir | ||
|
||
# Remove previously installed build dependencies, they are not needed anymore | ||
RUN apk del .build-deps | ||
|
||
# Copy the source code | ||
COPY src src | ||
|
||
EXPOSE 3000 | ||
CMD ["python", "src/server.py"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
services: | ||
website: | ||
build: | ||
dockerfile: Dockerfile.website | ||
ports: | ||
- "3000:3000" | ||
depends_on: | ||
- postgres_db | ||
|
||
postgres_db: | ||
image: postgres:latest | ||
environment: | ||
POSTGRES_USER: postgres | ||
POSTGRES_PASSWORD: postgres | ||
POSTGRES_DB: plakplaats-db | ||
ports: | ||
- "5432:5432" |