Skip to content

Commit

Permalink
docker
Browse files Browse the repository at this point in the history
  • Loading branch information
ericpp committed Mar 26, 2023
1 parent 32d4c93 commit 314519a
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM node:16

WORKDIR /var/www/html
COPY . /var/www/html

RUN corepack enable \
&& corepack prepare yarn@stable --activate \
&& yarn install

ENTRYPOINT ["yarn", "production"]
14 changes: 14 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
services:
nginx:
image: nginx
ports:
- '8000:80'
volumes:
- ./docker/nginx.conf:/etc/nginx/conf.d/default.conf
server:
build: .
entrypoint: ['yarn', 'production']
expose:
- 5001
volumes:
- .:/var/www/html
17 changes: 17 additions & 0 deletions docker/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
server {
if ($host = www.podcastindex.org) {
return 302 https://podcastindex.org$request_uri;
}

root /var/www/html;
index index.html;
server_name www.podcastindex.org podcastindex.org localhost;
location / {
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $http_host;
#proxy_pass http://127.0.0.1:8000; # First attempt to serve request as file, then
proxy_pass http://server:5001; # First attempt to serve request as file, then
}
listen 80 default_server;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
}

0 comments on commit 314519a

Please sign in to comment.