Skip to content

Commit

Permalink
feat: updated docker files to allow nginx routing
Browse files Browse the repository at this point in the history
  • Loading branch information
lkaesberg committed Mar 28, 2024
1 parent 2e2873a commit 9192840
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ services:
- DATABASE_HOST=db
- DATABASE_NAME=preprint_db_dev
- DATABASE_PORT=5432
- CORS_URL=http://localhost:3000
- CORS_URL=["http://localhost:3000"]
ports:
- "9000:9000"
depends_on:
Expand Down
5 changes: 4 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@ services:
- DATABASE_HOST=db
- DATABASE_NAME=preprint_db
- DATABASE_PORT=5432
- CORS_URL=http://localhost:3000
- CORS_URL=["http://localhost:3000"]
ports:
- "9000:9000"
volumes:
- pdfs:/usr/src/app/uploads
depends_on:
- db

Expand All @@ -40,3 +42,4 @@ services:

volumes:
postgres_data:
pdfs:
11 changes: 11 additions & 0 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,17 @@ FROM nginx:alpine
# Copy the build output to replace the default nginx contents.
COPY --from=build /app/build /usr/share/nginx/html

# Overwrite the default Nginx config
RUN printf 'server {\n\
listen 80;\n\
server_name preprint.larskaesberg.de;\n\
root /usr/share/nginx/html;\n\
index index.html;\n\
location / {\n\
try_files $uri $uri/ /index.html;\n\
}\n\
}' > /etc/nginx/conf.d/default.conf

# Expose port 80 to the Docker host, so we can access it
# from the outside.
EXPOSE 80
Expand Down

0 comments on commit 9192840

Please sign in to comment.