mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-05 19:20:12 +08:00
build: setup Docker dev configuration
- Add `.dockerignore` file - Add `Dockerfile.dev` - Modify `docker-compose.yml`: - Add `restart: on-failure` to `app` service - Modify `build` section of `app` service - Remove `links` section from `app` service - Add `networks` section to `app` and `db` services - Add `networks` section to the end of the file Signed-off-by: wancat <wancat@wancat.cc>
This commit is contained in:
1 parent
3cea54ce71
commit
189c87df5a
3 files changed
+33
-3
No files matched your search
@@ -0,0 +1,2 @@
|
|||||||
|
node_modules
|
||||||
|
.git
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
FROM node
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
COPY package.json yarn.lock ./
|
||||||
|
COPY server/package.json ./server/
|
||||||
|
RUN yarn install --frozen-lockfile
|
||||||
|
|
||||||
|
WORKDIR /app/server
|
||||||
|
|
||||||
|
ENV NODE_ENV=development
|
||||||
|
ENV HOST=0.0.0.0
|
||||||
|
ENV PORT=3000
|
||||||
|
EXPOSE 3000
|
||||||
|
|
||||||
|
CMD [ "yarn", "dev" ]
|
||||||
+16
-3
@@ -2,19 +2,32 @@ version: '3'
|
|||||||
services:
|
services:
|
||||||
app:
|
app:
|
||||||
image: lancatlin/linux-odyssey
|
image: lancatlin/linux-odyssey
|
||||||
build: .
|
restart: on-failure
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: Dockerfile.dev
|
||||||
|
networks:
|
||||||
|
- internal
|
||||||
|
- players
|
||||||
ports:
|
ports:
|
||||||
- '3000:3000'
|
- '3000:3000'
|
||||||
links:
|
|
||||||
- db
|
|
||||||
volumes:
|
volumes:
|
||||||
- /var/run/docker.sock:/var/run/docker.sock
|
- /var/run/docker.sock:/var/run/docker.sock
|
||||||
|
- ./server:/app/server
|
||||||
environment:
|
environment:
|
||||||
- MONGO_URL=mongodb://db:27017/odyssey-test
|
- MONGO_URL=mongodb://db:27017/odyssey-test
|
||||||
|
- DOCKER_NETWORK=linux-odyssey-players
|
||||||
db:
|
db:
|
||||||
image: mongo
|
image: mongo
|
||||||
restart: always
|
restart: always
|
||||||
|
networks:
|
||||||
|
- internal
|
||||||
ports:
|
ports:
|
||||||
- '27017:27017'
|
- '27017:27017'
|
||||||
volumes:
|
volumes:
|
||||||
- ./data:/data/db
|
- ./data:/data/db
|
||||||
|
|
||||||
|
networks:
|
||||||
|
internal:
|
||||||
|
players:
|
||||||
|
name: linux-odyssey-players
|
||||||
Reference in new issue
Block a user